﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<InvoiceInvoker.MvcUI.ViewModels.InvoicesIndexViewModel>" %>
<%@ Import Namespace="InvoiceInvoker.MvcUI.Helpers" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Historia Faktur - InvoiceInvoker
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

	 <% using (Html.BeginForm()) { %>

    <fieldset>
        <legend>Filtr</legend>
		<table class="transparent">
			<tr>
			<td>
				<%: Html.LabelFor(model => model.Filter.Status) %>:
				<%: Html.DropDownListFor(model => model.Filter.Status, new SelectList(Html.GetInvoiceStatusList(), "Value", "Key", Model.Filter.Status)) %>
				<%: Html.LabelFor(model => model.Filter.Customer) %>:
				<%: Html.TextBoxFor(model => model.Filter.Customer, new { title = "Wpisz imię, nazwisko lub nazwę firmy klienta" }) %>
				<%: Html.LabelFor(model => model.Filter.ProductNames) %>:
				<%: Html.TextBoxFor(model => model.Filter.ProductNames, new { title = "Wpisz początki nazw produktów, oddzielając je przecinkami" }) %>
			</td>
			</tr>
			<tr>
			<td>
				<%: Html.LabelFor(model => model.Filter.MinDate) %>:
				<%: Html.TextBox("Filter.MinDate", Model.Filter.MinDate.ToShortDateString(), new { style = "width: 70px" })%>
				<%: Html.LabelFor(model => model.Filter.MaxDate) %>:
				<%:	Html.TextBox("Filter.MaxDate", Model.Filter.MaxDate.ToShortDateString(), new { style = "width: 70px" })%>
				<%: Html.LabelFor(model => model.Filter.MinValue) %>:
				<%: Html.TextBoxFor(model => model.Filter.MinValue, new { style = "width: 100px" })%>
				<%: Html.LabelFor(model => model.Filter.MaxValue) %>:
	        	<%: Html.TextBoxFor(model => model.Filter.MaxValue, new { style = "width: 100px" })%>
			</td>
			</tr>
			<tr>
			<td>
				<input type="submit" value="Filtruj" /> | <%: Html.ActionLink("Wyczyść", "Index") %>
			</td>
			</tr>
		</table>
    </fieldset>

    <% } %>

    <h3>Faktury (<%: Model.Invoices.Count %>):</h3>
	<%: Html.DisplayFor(model => model.Invoices, "InvoicesList") %>

</asp:Content>
